/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package nuce.entity;

import dataaccess.DataAccess;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;

/**
 *
 * @author LINHNC
 */
public class User {

    private int id;
    private String name;
    private String pass;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }
    public Vector getuser() throws SQLException
    {
        Vector v=new Vector();
        try{
            ResultSet rs=DataAccess.executeQuery("user_Select");
            while(rs.next())
            {
                User us=new User();
                us.setId(rs.getInt(1));
                us.setName(rs.getString(2));
                us.setPass(rs.getString(3));
                v.add(us);
            }
        }
        catch(SQLException sql)
        {
            System.out.println(sql.getMessage());
        }
        return v;
    }

}
